#include<iostream>
#include<cstdio>
using namespace std;
int main(){
	int n;
	cin>>n;
	if(n==1){
		cout<<"301";
	}
	else{
		printf("%d",301+((n-1)*420));
	}
} 
